package com.yangguang.huahui.mvp.presenter;

import com.yangguang.huahui.entity.Sellers;
import com.yangguang.huahui.mvp.model.CommonModel;
import com.yangguang.huahui.mvp.view.SellersView;
import com.yangguang.huahui.rx.RxManager;
import com.yangguang.huahui.rx.RxSubscriber;

/**
 * Created by Administrator on 2017/4/26.
 */

public class SellersPresenter extends BasePresenter<SellersView>{
    CommonModel model;

    public SellersPresenter() {
        model = new CommonModel();
    }
    public void getSeller(int page, String servicearea, String category, String identity, String authentication){
        mSubscription = RxManager.getInstance().doSubscribe(model.getSellers(page, servicearea, category, identity, authentication), new RxSubscriber<Sellers>(false) {
            @Override
            protected void _onNext(Sellers sellers) {
                mView.onSuccess(sellers);
            }

            @Override
            protected void _onError() {
                mView.onError();
            }
        });
    }
}
